/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved.							  */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib.  */
/*----------------------------------------------------------------------------*/

#ifndef UTILITY_H_
#define UTILITY_H_

#include <taskLib.h>

#define wpi_assert(condition) wpi_assert_impl(condition, #condition, __FILE__, __LINE__, __FUNCTION__)
#define wpi_assertCleanStatus(status) wpi_assertCleanStatus_impl(status, __FILE__, __LINE__, __FUNCTION__)
void wpi_assert_impl(bool conditionValue, const char *conditionText, const char *fileName, unsigned lineNumber, const char *funcName);
void wpi_assertCleanStatus_impl(signed int status, const char *fileName, unsigned lineNumber, const char *funcName);

#define wpi_fatal(error) wpi_fatal_impl(wpi_v_##error, wpi_s_##error, __FILE__, __LINE__, __FUNCTION__)
void wpi_fatal_impl(const int statusCode, const char *statusString, const char *fileName, unsigned lineNumber, const char *funcName);

void wpi_suspendOnAssertEnabled(bool enabled);
void wpi_stackTraceEnable(bool enabled);

unsigned short GetFPGAVersion(void);
unsigned GetFPGARevision(void);
unsigned GetFPGATime(void);
float GetChassisTemp(void);
int GetRIOUserSwitch(void);
void SetRIOUserLED(unsigned int state);
int GetRIOUserLED(void);
int ToggleRIOUserLED(void);
void SetRIO_FPGA_LED(unsigned int state);
int GetRIO_FPGA_LED(void);
int ToggleRIO_FPGA_LED(void);

#endif // UTILITY_H_
